package mainPackage;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

import vcf导出为excel.UserToExcelUI;
import excel导出为vcf.ExcelToUserUI;

public class SelectFunction implements ActionListener{

	JFrame f = new JFrame();
	JButton etv = new JButton("excel导出为联系人");
	JButton vte = new JButton("联系人导出为excel");

	
	public static void main(String[] args){
		new SelectFunction().selectFrame();
	}
	
	public void selectFrame(){
				
		etv.addActionListener(this);
		vte.addActionListener(this);
		
		JPanel p = new JPanel();
		p.setLayout(new FlowLayout());
		
		p.add(etv);
		p.add(vte);
		
		f.add(p);
		f.setBounds(300, 200, 400, 200);
		f.setVisible(true);
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource().equals(etv)){
			new ExcelToUserUI().MainFrame();
			f.dispose();
		}else if(e.getSource().equals(vte)){
			new UserToExcelUI().MainFrame();
			f.dispose();
		}
		
	}
}
